package com.example.ttt.functions;

import com.example.ttt.jcomp.JFrameComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.swing.*;

/*
* 修改播放状态显示的图标
* */
@Component
public class SetPlayStatus {

    @Autowired
    private JFrameComponent jFrameComponent;

    public void start(){
        //1 播放中   2暂停中
        if (jFrameComponent.getPlayActivity()) {
            jFrameComponent.getPlayerStop().setIcon(new ImageIcon(this.getClass().getClassLoader().getResource("static/pause-1.png")));
        } else{
            jFrameComponent.getPlayerStop().setIcon(new ImageIcon(this.getClass().getClassLoader().getResource("static/restart.png")));
        }
    }
}
